import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sunriz.javafx.server.model.DTO.ScadaConfigDTO;
import com.sunriz.javafx.server.utils.Scada.ScadaConfigUtil;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * ClassName: test1
 * Package: PACKAGE_NAME
 * Description:
 *
 * @Author BuTang
 * @Create 2024/12/6 16:46
 * @Version 1.0
 */
public class test1 {
    public static void main(String[] args) {
        int a = 65535 ;
        int b = 65535 ;
        long l = a << 16 | b;
        System.out.println(l);
    }

    @Test
    public void test(){
        List<ScadaConfigDTO> scadaConfigDTOS = ScadaConfigUtil.readScadaConfig();
        System.out.println(1);
    }

    @Test
    public void test2(){
        List<ScadaConfigDTO> data = new ArrayList<>();
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            String s = "D:/develop/code/Sunriz-JavaFX/configFile/demo.json";
            File file = new File(s);
            // 反序列化 JSON 为 List<ScadaConfigDTO> 对象
            data = objectMapper.readValue(file, new TypeReference<List<ScadaConfigDTO>>() {
            });
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
